fix: route forward and identity clients to dedicated base URLs#596
Merged
Conversation
david-ruiz-cko
previously approved these changes
May 12, 2026
|
Cache the identity ApiClient instance once in the CheckoutApiImpl constructor instead of constructing a new ApiClientImpl (with its own IdentityApiUriStrategy and HTTP client) inside each of the five identity clients. Behaviour unchanged; avoids redundant allocations for the five clients that all target the same identity host.
Per the AWS PrivateLink docs (https://www.checkout.com/docs/developer-resources/api/private-connections/aws-privatelink), the valid subdomain is the first eight characters of the client_id (alphanumeric only), optionally with the literal pl- prefix when calling through PrivateLink. Tighten the regex from RFC-1123-style hyphenated to ^(?:pl-)?[a-z0-9]+$ and update the test corpus: test-123 moves to the rejected list, pl-vkuhvk4v (the docs example) joins the accepted list, and pl-, foo-bar are added as rejected.
Per the swagger spec, all identity endpoints (applicants, identity-verifications, aml-verifications, face-authentications, id-document-verifications) require the OAuth scope identity-verification. Expose it as a typed enum constant so OAuth clients can request it without hardcoding the string.
620cd0b to
5f41929
Compare
david-ruiz-cko
previously approved these changes
Jun 30, 2026
PayPal as an APM is intermittently unavailable in sandbox, returning a 422 'apm_service_unavailable'. Skip the affected payment-context tests in that case instead of failing the build, mirroring the existing Tabby handling. Any other error still fails the test, so SDK regressions are not masked.
|
david-ruiz-cko
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
The forward service and the identity-verification services (applicant, identity-verification, AML screening, face-authentication, ID document verification) live on their own hosts in the swagger spec, not under
api.checkout.com. This PR adds dedicated URIs for both and routes the corresponding clients through them. It also tightens the subdomain validation regex to match the AWS PrivateLink prefix format documented at https://www.checkout.com/docs/developer-resources/api/private-connections/aws-privatelink —^(?:pl-)?[a-z0-9]+$(alphanumeric, optionally prefixed by the literalpl-). Finally, it exposes theidentity-verificationOAuth scope as a typed enum constant.Changes
src/main/java/com/checkout/Environment.java— addsforwardApiandidentityApiURIs to theSANDBOX/PRODUCTIONenum constants and constructorsrc/main/java/com/checkout/IEnvironment.java— addsgetForwardApi()andgetIdentityApi()to the interfacesrc/main/java/com/checkout/CustomEnvironment.java— addsforwardApi/identityApifields (Lombok@Builderexposes new builder methods)src/main/java/com/checkout/CheckoutApiImpl.java— addsForwardApiUriStrategyandIdentityApiUriStrategy; routesforwardClientto forward URI; caches the identityApiClientonce and reuses it acrossfaceAuthenticationClient,applicantClient,identityVerificationClient,idDocumentVerificationClient,amlScreeningClientsrc/main/java/com/checkout/OAuthScope.java— addsIDENTITY_VERIFICATION("identity-verification")src/main/java/com/checkout/EnvironmentSubdomain.java— tightens regex to^(?:pl-)?[a-z0-9]+$src/test/java/com/checkout/DefaultCheckoutConfigurationTest.java— updates subdomain corpus: removestest-123from accepted, addspl-vkuhvk4v(docs example) to accepted, addstest-123/foo-bar/pl-to rejected; addsshouldHaveCorrectSandboxUrls/shouldHaveCorrectProductionUrls; extends custom-environment test to verify the new builder methodsAPI Reference
https://forward.checkout.com/https://forward.sandbox.checkout.com— forward service (POST /forward(beta),GET /forward/{id}(beta),POST /forward/secrets,GET|POST|DELETE /forward/secrets/{name}). Scopes:forward(plusforward:secretsfor secrets endpoints).https://identity-verification.checkout.com/https://identity-verification.sandbox.checkout.com— identity services (/applicants,/identity-verifications(beta),/aml-verifications(beta),/face-authentications(beta),/id-document-verifications(beta)). Scope:identity-verification.https://pl-{prefix}.api.{sandbox.,}checkout.com— AWS PrivateLink subdomain formatBreaking changes
IEnvironmentadds two abstract methods (getForwardApi,getIdentityApi). Any customIEnvironmentimplementation must implement them.test-123orfoo-bar-bazare rejected. Only plain alphanumeric or the literal PrivateLink form (pl-{prefix}) are accepted.README
Not affected.